#include <iostream>
#include <vector>

using namespace std;

class Solution
{
public:
    int singleNumber(vector<int>& nums)
    {
        int ans = 0;
        for (int i = 0; i < 32; i++)
        {
            int t = 0;
            for (int num : nums)
            {
                t += ((num >> i) & 1);
            }
            if (t % 3)
            {
                ans |= (1 << i);
            }
        }
        return ans;
    }
};
int main()
{
    vector<int> v;
    v.push_back(2);
    v.push_back(2);
    v.push_back(3);
    v.push_back(2);

    Solution xz;
    int n = xz.singleNumber(v);
    printf("%d", n);
	return 0;
}